package com.yx.robot.bean.robot;


import android.graphics.Bitmap;

public class ObjectRecognition {

    /**
     * 0x0000 电线
     * 0x0001 鞋子
     * 0x0002 袜子
     * 0x0003 毛巾
     * 0x0004 底座
     * 0x0005 体重秤
     * 0x0006 宠物餐盘
     * 0x0007 宠物粪便
     */
    public static final int TYPE_WIRE = 0;
    public static final int TYPE_SHOSE = 1;
    public static final int TYPE_SOCKS = 2;
    public static final int TYPE_TOWELS = 3;
    public static final int TYPE_BASE = 4;
    public static final int TYPE_SCALES = 5;
    public static final int TYPE_PET_PLATE = 6;
    public static final int TYPE_PET_FECES = 7;

    private int id;
    private String name;
    private int type;
    private Bitmap icon;
    private float x;
    private float y;
    private float rotation;
    private float similarity;

    public ObjectRecognition() {

    }

    private ObjectRecognition(Builder builder) {
        id = builder.id;
        name = builder.name;
        type = builder.type;
        icon = builder.icon;
        x = builder.x;
        y = builder.y;
        rotation = builder.rotation;
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Bitmap getIcon() {
        return icon;
    }

    public void setIcon(Bitmap icon) {
        this.icon = icon;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }


    public float getRotation() {
        return rotation;
    }

    public void setRotation(float rotation) {
        this.rotation = rotation;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getSimilarity() {
        return similarity;
    }

    public void setSimilarity(float similarity) {
        this.similarity = similarity;
    }

    public static final class Builder {
        private int id;
        private String name;
        private Bitmap icon;
        private int type;
        private int x;
        private int y;
        private float rotation;

        private Builder() {
        }

        public Builder id(int id) {
            this.id = id;
            return this;
        }

        public Builder type(int type) {
            this.type = type;
            return this;
        }

        public Builder position(int x, int y) {
            this.x = x;
            this.y = y;
            return this;
        }

        public Builder rotation(int rotation) {
            this.rotation = rotation;
            return this;
        }

        public Builder icon(Bitmap icon) {
            this.icon = icon;
            return this;
        }


        public Builder name(String name) {
            this.name = name;
            return this;
        }


        public ObjectRecognition build() {

            return new ObjectRecognition(this);
        }
    }
}
